<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?> style="margin-top:0px !important;">

<head profile="http://gmpg.org/xfn/11">
	
	<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
	
	<?php if (is_search()) { ?>
	   <meta name="robots" content="noindex, nofollow" /> 
	<?php } ?>

	<title>
		   <?php
		      if (function_exists('is_tag') && is_tag()) {
		         single_tag_title("Tag Archive for &quot;"); echo '&quot; - '; }
		      elseif (is_archive()) {
		         wp_title(''); echo ' Archive - '; }
		      elseif (is_search()) {
		         echo 'Search for &quot;'.wp_specialchars($s).'&quot; - '; }
		      elseif (!(is_404()) && (is_single()) || (is_page())) {
		         wp_title(''); echo ' - '; }
		      elseif (is_404()) {
		         echo 'Not Found - '; }
		      if (is_home()) {
		         bloginfo('name'); echo ' '; bloginfo('description'); }
		      else {
		          bloginfo('name'); }
		      if ($paged>1) {
		         echo ' - page '. $paged; }
		   ?>
	</title>
	
	<link rel="shortcut icon" href="<?php bloginfo('template_directory');?>/images/favicon.ico" type="image/x-icon" />

	<link rel="icon" href="<?php bloginfo('template_directory');?>/images/favicon.ico" type="image/x-icon">
	
	<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" />
	
	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

	<script src="<?php echo get_template_directory_uri(); ?>/js/jquery.min.js" type="text/javascript"></script>

	<script src="<?php echo get_template_directory_uri(); ?>/js/jquery.scrollTo.js" type="text/javascript"></script>

	<script src="<?php echo get_template_directory_uri(); ?>/js/jquery.nav.js" type="text/javascript"></script>

	<script src="<?php echo get_template_directory_uri(); ?>/js/jquery.fullbg.min.js" type="text/javascript"></script>
	
	<script src="<?php echo get_template_directory_uri(); ?>/js/jquery-ui-1.8.22.dialog.fade.min.js" type="text/javascript"></script>

	<script src="<?php echo get_template_directory_uri(); ?>/js/jquery.rs.slideshow.min.js" type="text/javascript"></script>

	<script src="<?php echo get_template_directory_uri(); ?>/js/jquery.pagescroller.lite.js" type="text/javascript"></script>

	<script src="<?php echo get_template_directory_uri(); ?>/js/scroll-startstop.events.jquery.js" type="text/javascript"></script>

	<?php
		function my_scripts_method() {
		    wp_deregister_script( 'jquery' );
		    wp_register_script( 'jquery', get_template_directory_uri()+'/js/jquery.min.js');
		    wp_enqueue_script( 'jquery' );
		}    
		 
		add_action('wp_enqueue_scripts', 'my_scripts_method');
	?>

	<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>

	<?php wp_head(); ?>

	<script>
		$(document).ready(function() {
			$('#slideshow-products').rsfSlideshow({
				autostart: false,
				controls: {
			        previousSlide: {auto: true},
			        nextSlide: {auto: true},
			        index: {auto: true}
			    }
			});
			// $('html').css('margin-top','0');
			// alert('Screen size:'+screen.width);
			$('.section#eco-friendly').css('background-size',$(window).width());
			// $('.section#eco-friendly').css('height',$(window).height());
			// if ($(window).width()>=1024) {
			// 	alert('Screen size: 1024x768 or larger');
			// 	//$("link[rel=stylesheet]:not(:first)").attr({href : "detect1024.css"});
			// }
			// else  {
			// 	alert('Screen size: less than 1024x768, 800x600 maybe?');
			// 	//$("link[rel=stylesheet]:not(:first)").attr({href : "detect800.css"});
			// }
			$(".why-us-details").dialog({
				autoOpen: false
			});

			$('a.list-why-us').click(function() {
				var id = $(this).attr('id').split('why-us-')[1];
				$('#'+id).dialog('open');
				return false;
			});

			//$('.section#eco-friendly').fullBg();
			var url = $('.section#eco-friendly').css('background-image').replace('url(', '').replace(')', '').replace('"', '').replace('"', '');
			// alert(url);
			var bgImg = $('<img />');
			bgImg.hide();
			bgImg.bind('load', function()
			{
			    var height = $(this).height();

			    height=($(window).width()/$(this).width()) * height;
			    $('.section#eco-friendly').css('height',height-70);
			    // $('.section#eco-friendly').css('background-size',$(window).width()+' '+height);
			    // alert($('.section#eco-friendly').css('background-size'));
			});
			$('.section#eco-friendly').append(bgImg);
			bgImg.attr('src', url);

			// Product Navigation
			$('a img#left-nav').on('click',function() {
				var active_entry = $('div.post div.entry-active');
				var id = 0;
				// alert(id);
				id = $('div.post div.entry-active').attr('id').split('-')[1];
				// alert(id);
				$('div.post div.entry-active').hide();
				$('div.post div.entry-active').attr('class','entry');
				if(id == 1){
					id = $('div.post div').length;
				}
				else {
					id--;
				}
				$('div#entry-'+id).attr('class','entry-active');
				$('div#entry-'+id).show();
				
				$('div.active#img-link').attr('class','');
				$('ul.post-image a.active').attr('class','no-active');
				$('ul.post-image a#product-'+id).attr('class','active');
				$('div#img-link a.active').parent().attr('class','active');
				// $('img#selected').remove();
				// $('ul.post-image a.active').append('<img id="selected" src="<?php bloginfo('template_directory'); ?>/images/active_layer.png" />');
				// $('img#selected').css('z-index','100');
				// $('img#selected').css('position','relative');
				// $('img#selected').css('top','-73px');
				// $('img#selected').css('opacity','0.3');

				var group = $('ul.post-image a.active').parent().parent().parent().attr('id').split('-')[1];
				$('li#group-list-'+group+' a').trigger('click');
				// alert(id);
				$('a.rs-prev').trigger('click');
				return false;
			});

			$('a img#right-nav').on('click',function() {
				var active_entry = $('div.post div.entry-active');
				var id = 0;
				id = $('div.post div.entry-active').attr('id').split('-')[1];
				// alert(id);
				$('div.post div.entry-active').hide();
				$('div.post div.entry-active').attr('class','entry');
				if(id == $('div.post div').length){
					id = 1;
				}
				else {
					id++;
				}
				$('div#entry-'+id).attr('class','entry-active');
				$('div#entry-'+id).show();

				$('div.active#img-link').attr('class','');
				$('ul.post-image a.active').attr('class','no-active');
				$('ul.post-image a#product-'+id).attr('class','active');
				$('div#img-link a.active').parent().attr('class','active');
				// $('img#selected').remove();
				// $('ul.post-image a.active').append('<img id="selected" src="<?php bloginfo('template_directory'); ?>/images/active_layer.png" />');
				// $('img#selected').css('z-index','100');
				// $('img#selected').css('position','relative');
				// $('img#selected').css('top','-73px');
				// $('img#selected').css('opacity','0.3');

				// console.log($('div.post div.entry[active="true"]'));
				var group = $('ul.post-image a.active').parent().parent().parent().attr('id').split('-')[1];
				$('li#group-list-'+group+' a').trigger('click');
				// alert(id);
				$('a.rs-next').trigger('click');
				return false;
			});

			$('ul.groups a').on('click',function() {
				// alert($(this).attr('id'));
				var id = $(this).attr('id');
				$('li.group a.active').attr('class','');
				$(this).attr('class','active');
				$('div.list-products-current').hide();
				$('div.list-products-current').attr('class','list-products');

				$('div#group-'+id).show();
				$('div#group-'+id).attr('class','list-products-current');

				
				return false;
			});

			$('ul.post-image a').on('click',function() {
				var id = $(this).attr('id').split('-')[1];
				// alert(id);
				$('ul.post-image a.active').attr('class','no-active');
				$(this).attr('class','active');
				$('.entry').hide();
				$('.entry-active').hide();
				$('#entry-'+id).show();
				$('div.entry-active').attr('class','entry');
				$('#entry-'+id).attr('class','entry-active');
				// alert($('#entry-'+id).attr('id'));

				
				// alert(id);

				$('div.active#img-link').attr('class','');
				$('ul.post-image a.active').attr('class','no-active');
				$('ul.post-image a#product-'+id).attr('class','active');
				// $('img#selected').remove();
				// $('ul.post-image a.active').append('<img id="selected" src="<?php bloginfo('template_directory'); ?>/images/active_layer.png" />');
				// $('img#selected').css('z-index','100');
				// $('img#selected').css('position','relative');
				// $('img#selected').css('top','-73px');
				// $('img#selected').css('opacity','0.3');
				$('div#img-link a.active').parent().attr('class','active');
				

				id = id - 1;

				$('a.rs-index[data-slide-key='+id+']').trigger('click');
				return false;
			});
			
		  // $('#nav').onePageNav({
		  //   currentClass: 'current',
		  //   changeHash: false,
		  //   scrollSpeed: 750,
		  //   scrollOffset: 165,
		  //   scrollThreshold: 0.5,
		  //   filter: '',
		  //   easing: 'swing',
		  //   begin: function() {
			 //  console.log('start')
		  //   },
		  //   end: function() {
			 //  console.log('stop')
		  //   },
		  //   scrollChange: function($currentListItem) {
		  //       //I get fired when you enter a section and I pass the list item of the section
		  //   }
		  // });

		  $('#container').pageScroller({
		  	navigation: '#nav',
		  	scrollOffset: -165,
		  	animationSpeed: 750
		  });

		  $('div#controls a.next').on('click',function() {
		 	pageScroller.next();
		 	return false;
		  });

		  $('div#controls a.prev').on('click',function() {
		 	pageScroller.prev();
		 	return false;
		  });

		  $('div#controls a.prev').hide();

		  $(window).bind('scrollstop',function(){
		  	if($('li.active a').html() == "HOME") {
		  		$('div#controls a.prev').hide();
		  		$('div#controls a.next').show();
		  	}
		  	else if ($('li.active a').html() == "CONTACT US") {
		  		$('div#controls a.prev').show();
		  		$('div#controls a.next').hide();
		  	}
		  	else {
		  		$('div#controls a.prev').show();
		  		$('div#controls a.next').show();
		  	}
		  });

		  // $(window).scroll(function() {
		  // 	if($('li.active a').html() == "HOME") {
		  // 		$('div#controls a.prev').hide();
		  // 		$('div#controls a.next').show();
		  // 	}
		  // 	else if ($('li.active a').html() == "CONTACT US") {
		  // 		$('div#controls a.prev').show();
		  // 		$('div#controls a.next').hide();
		  // 	}
		  // 	else {
		  // 		$('div#controls a.prev').show();
		  // 		$('div#controls a.next').show();
		  // 	}
		  // });

		  	
		});
	</script>
	
</head>

<body <?php body_class(); ?>>
	
	<div id="page-wrap">

		<!-- <div id="header">
			<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
			<div class="description"><?php bloginfo('description'); ?></div>
		</div> -->

